<?php

session_start();
include_once '../control/conexao.php';
include_once '../model/submenu.class.php';
include_once '../model/submenuDAO.class.php';

$submenu = new submenu();
$submenu->submenu_nome = utf8_decode($_POST['nome']);
$submenu->submenu_link = utf8_decode($_POST['link']);
$submenu->submenu_icone = utf8_decode($_POST['icone']);
if (isset($_POST['show'])) {
    $submenu->submenu_show = 1;
} else {
    $submenu->submenu_show = 0;
}
$submenu->id_menu = utf8_decode($_POST['menu']);
$submenuDAO = new submenuDAO();
$submenuDAO->insere($submenu);
